package com.ruoyi.vote.common.runner;

import com.ruoyi.vote.admin.service.IVoteActivityService;
import com.ruoyi.vote.admin.service.IVoteSignService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author 立勤
 * @date 2023/07/18 16:33:15
 */
@Slf4j
@RequiredArgsConstructor
@Component
public class VoteApplicationRunner implements ApplicationRunner {

    private final IVoteActivityService activityService;
    private final IVoteSignService signService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        activityService.loadingActivityCache();
        log.info("初始化活动配置成功");
        signService.loadingSignCache();
        log.info("初始化选手配置成功");
    }
}
